﻿using Microsoft.AspNetCore.Mvc.Filters;

namespace WebAPI测试程序.Filters
{
    public class EncryptFilter : IActionFilter
    {
        private readonly ILogger<EncryptFilter> _logger;

        public EncryptFilter(ILogger<EncryptFilter> logger)
        {
            _logger = logger;
        }

        public void OnActionExecuted(ActionExecutedContext context)
        {
            HttpRequest request = context.HttpContext.Request;
            PathString path = request.Path;
            RouteValueDictionary routeValues = request.RouteValues;
            IQueryCollection query = request.Query;
            object queryString = request.QueryString;
            Stream body = request.Body;


            Console.WriteLine("-------------------");
        }

        public void OnActionExecuting(ActionExecutingContext context)
        {
            _logger.LogInformation("程序执行结束");
        }
    }
}
